#ifndef MOSES_ITEMLIST_H
#define MOSES_ITEMLIST_H

#include <vector>
#include "Item.h"

namespace moses
{

	template<typename T>
	class ItemList : public Item, protected std::vector<T*>
	{
	public:
		virtual ~ItemList() { }
	
		using std::vector<T*>::push_back;
		using std::vector<T*>::size;
		using std::vector<T*>::operator[];
		
		virtual void Visit(Visitor *pVisitor) { VisitAll(pVisitor); }
		
		void VisitAll(Visitor *pVisitor)
		{
			for (size_t i = 0; i < size(); i++)
				operator[](i)->Visit(pVisitor);
		}
	};
	
}

#endif
